<template>
  <div>
    <div class="content">
      <dl class="company_center_content">
        <dt>
          <h1>
            <em></em>
            在审核招职位 <span>（共<i style="color:#fff;font-style:normal" id="positionNumber">{{pageInfo.total}}</i>个）</span></h1>
        </dt>
        <dd>

          <div id="searchForm" v-for=" item in pageInfo.list" :key="item.positionId">
            <ul class="reset my_jobs">
              <li data-id="149594">
                <h3>
                  <a target="_blank"  href="#">{{item.positionName}}</a>
                  <span>[{{item.city}}]</span>
                </h3>
                <span class="receivedResumeNo">
                  <h4 v-if="item.ischeck==0" style="color:#909399">审核中...</h4>
                  <h4 v-if="item.ischeck==2" style="color:#F56C6C">审核失败！</h4>
                </span>
                <div>{{item.jobNature}} / {{item.minSalary}}k-{{item.maxSalary}}k / {{item.workExp}} / {{item.eduRequirements}}及以上</div>
                <div class="c9">发布时间：{{makeDate(item.createTime)}} </div>
                <div class="links">

                  <el-button @click="GoupdatePosition(item.positionId)"  type="primary" plain size="mini">编辑</el-button>
                   <el-button @click="deletePosition(item.positionId)" type="danger" plain size="mini">删除</el-button>

                </div>
              </li>
            </ul>
          </div>
        </dd>
      </dl>
      <div style="float: right">
        <el-pagination
                background
                layout="prev, pager, next"
                :total="pageInfo.total"
                :page-size="pageInfo.pageSize"
                @current-change="handlePage"
        >
        </el-pagination>
      </div>
    </div><!-- end .content -->

  </div>
</template>

<script>
  import {makeDate} from "../../../common/js/dateformat"
  export default {
    name: "no-checked-position",
    data(){
      return{
        loading:true,
        pageIndex: 1,
        pageInfo:{},
        form: {
          positionId:'',
          hrId:'',
          minMoney:'',
          maxMoney:'',
          positionName: '',
          workExp: '',//工作经验
          jobNature: '',
          eduRequirements: '',
          jobclassify: '',
          bussionName: '',
          isdeleted: 0,//未被删除
          isOpen:''
        },
      }
    },
    created(){
      this.form.hrId = this.$store.state.hr.hrId;
      this.getPosition();
    },
    methods:{
      getPosition(){
        this.$ajax.post(this.$config.url + `/position/selNoCheckedPosition/${this.pageIndex}`, this.form)
            .then(res => {
              this.pageInfo = res.data
              console.log("positionSelect开始执行");
            }).finally(() => {
        })
      },
      makeDate(date){
        return makeDate(date)
      },
      deletePosition(positionId){
        {
          this.$confirm('此操作将永久删除该职位, 是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            this.$ajax.post(this.$config.url + `/position/deletePosition/${positionId}`).then(res => {
              if (res.data === true) {
                console.log(res.data);
                this.$message.success("删除成功！");
                //刷新数据
                this.getPosition();
              } else {
                this.$message.error("删除失败！")
              }
              console.log("positionSelect开始执行");
            }).finally(() => {
            })
          }).catch(() => {
            this.$message({
              type: 'info',
              message: '已取消删除'
            });
          });
        }
      },
      GoupdatePosition(positionId){
        this.$router.push(`UpdatePosition/${positionId}`)
      },
      handlePage(val){
        //console.log(val)
        this.pageIndex = val
        //加载数据
        this.getPosition()
      },
    }
  }
</script>

<style scoped>
  .c9{color:#999;}
  .content{ width:744px; float:left;}
  .company_center_content{background-color:#fafafa;margin-top:5px;position:relative}
  .company_center_content>dt{height:47px;position:absolute;z-index:1;top:-5px;left:40px;background-color:#91cebe}
  .company_center_content>dt h1{color:#fff;font-size:24px;font-weight:normal;line-height:47px;padding:0 20px;margin:0}
  span{font-size:20px}
  .company_center_content>dd{min-height:337px;padding:70px 0;position:relative}
  .company_center_content>dd .ccc_tr span{color:#019875;font-weight:600}
  ul.reset{margin:0;padding:0;list-style:none;}
  .company_center_content .my_jobs{margin:0 40px}
  ul.my_jobs{margin:20px 0 0 0;}
  .my_jobs li{ margin-bottom:30px;border-left:3px solid #91cebe; padding:2px 10px 2px 15px; background:#fff;}
  .my_jobs h3{padding:5px 0; margin:0!important; font-weight:normal;}
  .my_jobs h3 a{font-size:18px; color:#0d9572; }
  .my_jobs h3 span{color:#999;font-size:14px; float:none;margin-left:0;margin-right:10px;}
  /*.my_jobs span.receivedResumeNo a{font-size:16px;color:#0d9572;}*/
  .my_jobs span{color:#999;font-size:14px; float:right; margin-top:-30px;}
  .my_jobs li span.expireDay{color:#555;margin-left:10px;}
  .my_jobs li span.expireDay i{color:#e46a4a;font-style:normal;font-weight:bold;}
  .my_jobs li div{margin:5px 0;}
  my_jobs li div.links{position:absolute;float:right; margin-top:-30px;right:50px; }
  .my_jobs .links{color:#019875;font-size:16px; float:right; margin-top:-30px;}
  .links a{color:#0d9572; text-decoration:underline; margin-left:8px;}
  .links a:hover{color:#0d9572; text-decoration:underline;}
</style>